package com.hzdl.car.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzdl.car.bean.Car;
import com.hzdl.car.bean.Customer;
import com.hzdl.car.bean.RentInfo;
import com.hzdl.car.mapper.RentInfoMapper;
import com.hzdl.car.service.RentInfoService;
import com.hzdl.car.vo.CarVo;
import com.hzdl.car.vo.RentInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RentInfoServiceImpl implements RentInfoService {

    @Autowired
    private RentInfoMapper rim;
    @Override
    public PageInfo findAllCar(CarVo carVo) {
        PageHelper.startPage(carVo.getPage(),carVo.getLimit());
        List<Car> cList = rim.findAllCar(carVo);
        PageInfo pageInfo = new PageInfo(cList);
        return pageInfo;
    }

    @Override
    public int selectByIndentity(String identity) {
        int i = rim.selectByIndentity(identity);
        return i;
    }

    @Override
    public int rentCar(String carnumber) {
        return rim.rentCar(carnumber);
    }

    @Override
    public int insertRentInfo(RentInfo rentInfoVo) {
        return rim.insertRentInfo(rentInfoVo);
    }
}
